package com.etone.smartAudit.controller;

import com.etone.smartAudit.annotation.LoginAdmin;
import com.etone.smartAudit.domain.Admin;
import com.etone.smartAudit.service.WorkOrderItemService;
import com.etone.smartAudit.vo.PUumUserinfoVO;
import com.etone.smartAudit.vo.workOrder.AuditManVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * @author 张任豪
 */
@RestController
@AllArgsConstructor
@Api(tags = "工单字典", value = "WorkOrderItemController")
public class WorkOrderItemController {

    private WorkOrderItemService workOrderItemService;

    @ApiOperation(value = "通过用户账号查询所属部门人员")
    @GetMapping("/workItem/getDeptMan")
    public List<PUumUserinfoVO> getDeptMan(
            @ApiIgnore @LoginAdmin Admin admin,
            @ApiParam("用户id（默认选择当前登录对象所在的部门）") @RequestParam(value = "id",required = false) Integer id
    ) {
        return workOrderItemService.getDeptMan(admin,id);
    }
}
